import org.specs._
import org.specs.collection._
import org.specs.matcher._
import org.specs.runner._

import org.specs.runner.ConsoleRunner

import eventfax.protocol._

object lineProtocolRunner extends ConsoleRunner(lineProtocolSpec)

object lineProtocolSpec extends Specification {
  "Line Protocol for single newline" should {
    "have buffer input length of 1" in {
      var buftok: LineProtocol = new LineProtocol("[\r\n]")
      buftok.extract("Hello World\n Man")
      buftok.input.length must be(1)
    }
  }
  "Line protocol for no new line" should {
    "have no data in buffer input" in {
      var buftok: LineProtocol = new LineProtocol("[\r\n]")
      buftok.extract("Hello World")
      buftok.input.length must be(0)
    }
  }
}
